<script setup>
import { ref } from "vue"
import { invoke } from "@tauri-apps/api/core"
import { onMounted } from 'vue'
const greetMsg = ref("");
const name = ref("");

async function greet() {
  // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
  greetMsg.value = await invoke("greet", { name: name.value });
}

async function getMusicData() {
  let data = await invoke("get_music_data")
  console.log("data",data);
}

onMounted(async () => {
   
  await getMusicData()
       
     })

</script>

<template>
  <form class="row" @submit.prevent="greet">
    <input id="greet-input" v-model="name" placeholder="Enter a name..." />
    <button type="submit">Greet</button>
  </form>

  <p>{{ greetMsg }}</p>

</template>
